/* DxfCIRCLE.java
 *
 * Created on 6 de Dezembro de 2007, 10:27
 *
 * Modified on 08/18/2011, 10:43 AM by Adriano
 * Included the attribute @Override to inherited methods
 */

package importadorDXF;

import mathematics.Point3D;

/**
 * @author rafaelbuck
 * @author Adriano Ferreira
 */
public class DxfCIRCLE extends DxfEntity
{    
    protected Point3D center;
    protected float radius;
    
    /** Creates a new instance of DxfCIRCLE */
    public DxfCIRCLE()
    {
        center = new Point3D();
    }
    
    @Override
    public boolean setGroup(short grpNr, float fval)
    {
        switch(grpNr)
        {
        case 10: // '\n'
        case 20: // '\024'
        case 30: // '\036'
            setCoord(center, grpNr / 10, fval);
            return true;

        case 40: // '('
            radius = fval;
            return true;
        }
        return super.setGroup(grpNr, fval);
    }

    @Override
    public void convert(DxfConverter converter, DxfFile dxf, Object collector)
    {
        converter.convert(this, dxf, collector);
    }

    public float getRadius()
    {
        return radius;
    }

    public Point3D getCenter()
    {
        return center;
    }   
}